# -*- coding:utf-8 -*-
__author__ = 'Serprutiy'

import sys
import os


def get_module():

    def main_module_name():
        mod = sys.modules['__main__']
        file = getattr(mod, '__file__', None)
        return file and os.path.splitext(os.path.basename(file))[0]

    def modname(fvars):
        file, name = fvars.get('__file__'), fvars.get('__name__')
        if file is None or name is None:
            return None

        if name == '__main__':
            name = main_module_name()
        return name
    module_name = modname(globals())

# get_module()

class Error(Exception):
    name = 'test'

    def __init__(self):
        self.name = 'xiaowanzi'

